package com.jxin.mall.weixin.domain.entity.service;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 图灵接口请求正文类
 * @author 蔡佳新
 * @version 1.0
 * @since jdk 1.8
 */
@NoArgsConstructor
@AllArgsConstructor
@Data
@Builder
public class TuLingRequestBody {
    /**请求类型*/
    private int reqType;
    /**消息正文*/
    private Perception perception;
    /**用户信息*/
    private UserInfo userInfo;

    @NoArgsConstructor
    @AllArgsConstructor
    @Data
    @Builder
    public static class Perception {
        /**输入的消息*/
        private InputText inputText;

        @NoArgsConstructor
        @AllArgsConstructor
        @Data
        public static class InputText {
            /**消息正文*/
            private String text;
        }

        /**
         * 创建一个文本输入流
         * @param text 文本
         * @return {@link InputText} 文本输入流
         * @author 蔡佳新
         */
        public static InputText creatInputText(String text){
          return new InputText(text);
        }
    }

    @NoArgsConstructor
    @AllArgsConstructor
    @Data
    @Builder
    public static class UserInfo {
        /**机器人编号*/
        private String apiKey;
        /**图灵账号唯一key*/
        private String userId;
    }
}
